//
// Created by aaa on 2025/7/14.
//

#include<bits/stdc++.h>

using namespace std;
const int N = 1e5;

int T,n,v[N],dp[N][2];

//2
//3
//1 8 2
//4
//10 7 6 14
int main(){
    cin >> T;

    while(T--){
        cin >> n;
        for(int i = 1;i <= n;i++) cin >> v[i];

        //分步转移
//        dp[1] = v[1];
//        for(int i = 2;i <= n;i++) dp[i] = max(dp[i - 1],dp[i - 2] + v[i]);
//        cout << dp[n] << endl;

        //分类转移
        dp[1][0] = 0,dp[1][1] = v[1];
        for(int i = 2;i <= n;i++){
            dp[i][0] = max(dp[i - 1][0],dp[i - 1][1]);
            dp[i][1] = dp[i-1][0] + v[i];
        }

        cout << max(dp[n][0],dp[n][1]) << endl;
    }


    return 0;
}